// //  jQuery切换页面
// // 获取元素
// var tab_list = document.querySelector(".tab_list");
// var lis = tab_list.querySelectorAll("li");
// var items = document.querySelectorAll(".item");
// //遍历tab标签
// for(var i=0; i<lis.length; i++){
//     // 为标题添加索引
//     lis[i].setAttribute("data-index",i);
//
//     items[1].style.display = "none";
//     items[2].style.display = "none";
//     items[3].style.display = "none";
//
//     //绑定事件
//     lis[i].onclick = function() {
//         //将其他tab的class清楚掉，排他思想
//         for(var i=0; i<lis.length; i++){
//             lis[i].className = "";
//         }
//         this.className = "current";
//
//         // 切换标签内容
//         var index = this.getAttribute("data-index");
//         for(var i=0; i<items.length; i++){
//             items[i].style.display = "none";
//         }
//         items[index].style.display = "block";
//     }
// }

function initParameter(asideStatus, currentPage) {
    //  侧边栏初始点击
    var aside1 = document.getElementById("aside1");
    var aside2 = document.getElementById("aside2");
    var aside3 = document.getElementById("aside3");
    var aside4 = document.getElementById("aside4");
    // 页面展示
    var item1 = document.getElementById("item1");
    var item2 = document.getElementById("item2");
    var item3 = document.getElementById("item3");
    var item4 = document.getElementById("item4");

    aside1.classList.remove("aside1");
    aside2.classList.remove("aside2");
    aside3.classList.remove("aside3");
    aside4.classList.remove("aside4");

    item1.style.display = "none";
    item2.style.display = "none";
    item3.style.display = "none";
    item4.style.display = "none";


    if (asideStatus === 1) {
        aside1.classList.add("current");
        var page = document.getElementById(currentPage);
        page.classList.add("active");
        item1.style.display = "block";
    } else if (asideStatus === 2) {
        aside2.classList.add("current");
        item2.style.display = "block";
    } else if (asideStatus === 3) {
        aside3.classList.add("current");
        item3.style.display = "block";
    } else if (asideStatus === 4) {
        aside4.classList.add("current");
        item4.style.display = "block";
    } else {
        aside1.classList.add("current");
        item1.style.display = "block";
    }
}

// 下拉框变化的时候发送请求
function clickOption(examineId) {
    var bookSelect = document.getElementById("bookSelect");
    // 拿出选中项索引
    var selectedIndex = bookSelect.selectedIndex;
    if (selectedIndex > 0) {
        let id = bookSelect.options[selectedIndex].id;
        window.location.href = "medicalPlanOption?examineId=" + id + "&index=" + selectedIndex;
        window.event.returnValue = false; //return false是阻止游览器对事件的默认处理
    }
}

// 用户订单删除
function deleteUserOrderByDeletebutton(uid, eid, time) {
    window.location.href = "/DeleteOrderServlet?uid=" + uid + "&eid=" + eid + "&time=" + time + "&serviceType=2";
    // alert("/DeleteOrderServlet?uid="+uid+"&eid="+eid+"&time="+time+"&serviceType=2");
}





